<!DOCTYPE html>
<html>
    <head>
        <meta content="text/html; charset=utf-8" http-equiv="content-type">
            <title>js调用oc</title>
            <script type="text/javascript" src="jquery-1.8.3.min.js"></script>
            <script type="text/javaScript">
                
            var BRIDGE;
            
            $(document).ready(function()
            {
                connectWebViewJavascriptBridge(function(bridge)
                {
                    BRIDGE=bridge;
                    BRIDGE.init(function(message,responseCallback){});
                });
            });
            
            function connectWebViewJavascriptBridge(callback)
            {
                if (window.WebViewJavascriptBridge) {
                    callback(WebViewJavascriptBridge)
                } else {
                    document.addEventListener("WebViewJavascriptBridgeReady", function(){callback(WebViewJavascriptBridge)}, false);
                }
            }
                              
            function testClick(cmd)
            {
                
                if(BRIDGE!==undefined){
                    BRIDGE.callHandler("pop",cmd,null);
                }
            }
            </script>
            </head>
    <body>
        <p><input type="text" id="text1" value="哈喽，世界"/></p>
        <p><input type="text" id="text2" value="hello，world"/></p>
        <p><input type="button" id="enter" value="enter" onclick="testClick('getParam1:withParam2:');"/></p>
    </body>  
</html>

